home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.amiga.programmer
- Path: news.interlog.com!rose!awhite
- From: awhite@user.rose.com (A White)
- Subject: overloading operators...
- Sender: news@rose.com (news)
- Organization: Rose Media Incorpoarted, Ontario, Canada
- Message-ID: <DLFwoG.5xJ@rose.com>
- Date: Fri, 19 Jan 1996 18:00:15 GMT
-
- As a working example, I'm creating a variable class:
- class {
- var_t _type;
- union {
- ULONG _long;
- ...
- }
- ...
- } variable;
-
- I want to overload the various operators (=, +, -, ...) so that :
- variable A = 10;
- variable B = "!@#";
- variable C = 23.3;
-
- all construct as expected.
-
- Subsequently, I'd want to overload + so that I can add directly into the
- instance (addition, concatenation, etc).
-
- In both cases, my compiler (SAS/C++, Amiga) complains about second reference
- to overloaded operator.
-
- Is this a standard limitation of C++?
-
-